﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Etapa1.ComercioEspacial
{
    public partial class TravelOptions : Form
    {
        List<Planeta> planetas;
        Planeta atual;
        public TravelOptions(List<Planeta> planetas , Planeta atual)
        {
            this.planetas = planetas;
            this.atual = atual;
            InitializeComponent();
        }

        private void TravelOptions_Load(object sender, EventArgs e)
        {
            domainUpDown1.Items.Clear();
            foreach (var item in planetas)
            {
                if (item.NomeSistema != atual.NomeSistema) 
                    domainUpDown1.Items.Add(item.NomeSistema);    
            }
            domainUpDown1.SelectedItem = domainUpDown1.Items[0];
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            destino = domainUpDown1.SelectedItem as string;
            this.Close();
        }

        public string destino = null;
    }
}
